package com.xuecheng.content.api;


import com.xuecheng.content.model.dto.QueryCourseParamsDto;
import com.xuecheng.content.model.po.CourseBase;
import com.xuecheng.content.service.CourseBaseInfoService;
import com.xuecheng.model.PageParams;
import com.xuecheng.model.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description 课程信息编辑接口
 * @author Mr.M
 * @date 2022/9/6 11:29
 * @version 1.0
 */
 @RestController
 @Api("课程相关接口")
public class CourseBaseInfoController {

  @Autowired
  private CourseBaseInfoService courseBaseInfoService;

 @PostMapping("/course/list")
 @ApiOperation("课程列表查询接口")
  public PageResult<CourseBase> list(PageParams pageParams, @RequestBody QueryCourseParamsDto queryCourseParams){

      return courseBaseInfoService.queryCourseBaseList(pageParams,queryCourseParams);

  }
  @DeleteMapping("/course/{courseId}")
    @ApiOperation("删除课程")
    public void deleteCourse(@PathVariable Long courseId){
      Long compangId=1232141425L;
        courseBaseInfoService.deleteCourse(compangId,courseId);
  }

}